package com.zhou.listener;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

@Component
public class RedisPublish {
    @Autowired
    private RedisTemplate<String,String> redisTemplate;

    private static final String CHANNEL = "redis.msg";

    public void push(String msg){
        redisTemplate.convertAndSend(CHANNEL, msg);
    }

}
